package cn.hanyx.coder.design.pattern.behavioral.interpreter.demo02;

/**
 * AdditionExpression
 *
 * @author hanyx
 * @date 2020/07/30
 */
public class AdditionExpression implements Expression {

    private Expression exp1;
    private Expression exp2;

    public AdditionExpression(Expression exp1, Expression exp2) {
        this.exp1 = exp1;
        this.exp2 = exp2;
    }

    @Override
    public long interpret() {
        return exp1.interpret() + exp2.interpret();
    }
}
